using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Core_HGUI_CharacterInfoEx_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Core.HGUI.CharacterInfoEx);

            field = type.GetField("info", flag);
            app.RegisterCLRFieldGetter(field, get_info_0);
            app.RegisterCLRFieldSetter(field, set_info_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_info_0, AssignFromStack_info_0);
            field = type.GetField("color", flag);
            app.RegisterCLRFieldGetter(field, get_color_1);
            app.RegisterCLRFieldSetter(field, set_color_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_color_1, AssignFromStack_color_1);
            field = type.GetField("type", flag);
            app.RegisterCLRFieldGetter(field, get_type_2);
            app.RegisterCLRFieldSetter(field, set_type_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_type_2, AssignFromStack_type_2);
            field = type.GetField("Left", flag);
            app.RegisterCLRFieldGetter(field, get_Left_3);
            app.RegisterCLRFieldSetter(field, set_Left_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_Left_3, AssignFromStack_Left_3);
            field = type.GetField("Center", flag);
            app.RegisterCLRFieldGetter(field, get_Center_4);
            app.RegisterCLRFieldSetter(field, set_Center_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_Center_4, AssignFromStack_Center_4);
            field = type.GetField("Right", flag);
            app.RegisterCLRFieldGetter(field, get_Right_5);
            app.RegisterCLRFieldSetter(field, set_Right_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_Right_5, AssignFromStack_Right_5);
            field = type.GetField("VertexIndex", flag);
            app.RegisterCLRFieldGetter(field, get_VertexIndex_6);
            app.RegisterCLRFieldSetter(field, set_VertexIndex_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_VertexIndex_6, AssignFromStack_VertexIndex_6);
            field = type.GetField("fontSize", flag);
            app.RegisterCLRFieldGetter(field, get_fontSize_7);
            app.RegisterCLRFieldSetter(field, set_fontSize_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_fontSize_7, AssignFromStack_fontSize_7);
            field = type.GetField("ch", flag);
            app.RegisterCLRFieldGetter(field, get_ch_8);
            app.RegisterCLRFieldSetter(field, set_ch_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_ch_8, AssignFromStack_ch_8);

            app.RegisterCLRMemberwiseClone(type, PerformMemberwiseClone);

            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Core.HGUI.CharacterInfoEx());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Core.HGUI.CharacterInfoEx[s]);


        }

        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref huqiang.Core.HGUI.CharacterInfoEx instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch(ptr_of_this_method->ObjectType)
            {
                case ObjectTypes.Object:
                    {
                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
                    }
                    break;
                case ObjectTypes.FieldReference:
                    {
                        var ___obj = __mStack[ptr_of_this_method->Value];
                        if(___obj is ILTypeInstance)
                        {
                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            var t = __domain.GetType(___obj.GetType()) as CLRType;
                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                        }
                    }
                    break;
                case ObjectTypes.StaticFieldReference:
                    {
                        var t = __domain.GetType(ptr_of_this_method->Value);
                        if(t is ILType)
                        {
                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                        }
                    }
                    break;
                 case ObjectTypes.ArrayReference:
                    {
                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as huqiang.Core.HGUI.CharacterInfoEx[];
                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
                    }
                    break;
            }
        }


        static object get_info_0(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).info;
        }

        static StackObject* CopyToStack_info_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).info;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_info_0(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.info = (UnityEngine.CharacterInfo)v;
            o = ins;
        }

        static StackObject* AssignFromStack_info_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.CharacterInfo @info = (UnityEngine.CharacterInfo)typeof(UnityEngine.CharacterInfo).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.info = @info;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_color_1(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).color;
        }

        static StackObject* CopyToStack_color_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).color;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_color_1(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.color = (UnityEngine.Color32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_color_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Color32 @color = (UnityEngine.Color32)typeof(UnityEngine.Color32).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.color = @color;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_type_2(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).type;
        }

        static StackObject* CopyToStack_type_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).type;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_type_2(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.type = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_type_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @type = ptr_of_this_method->Value;
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.type = @type;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Left_3(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).Left;
        }

        static StackObject* CopyToStack_Left_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).Left;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Left_3(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.Left = (System.Single)v;
            o = ins;
        }

        static StackObject* AssignFromStack_Left_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @Left = *(float*)&ptr_of_this_method->Value;
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.Left = @Left;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Center_4(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).Center;
        }

        static StackObject* CopyToStack_Center_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).Center;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Center_4(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.Center = (System.Single)v;
            o = ins;
        }

        static StackObject* AssignFromStack_Center_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @Center = *(float*)&ptr_of_this_method->Value;
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.Center = @Center;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Right_5(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).Right;
        }

        static StackObject* CopyToStack_Right_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).Right;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Right_5(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.Right = (System.Single)v;
            o = ins;
        }

        static StackObject* AssignFromStack_Right_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @Right = *(float*)&ptr_of_this_method->Value;
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.Right = @Right;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_VertexIndex_6(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).VertexIndex;
        }

        static StackObject* CopyToStack_VertexIndex_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).VertexIndex;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_VertexIndex_6(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.VertexIndex = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_VertexIndex_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @VertexIndex = ptr_of_this_method->Value;
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.VertexIndex = @VertexIndex;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_fontSize_7(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).fontSize;
        }

        static StackObject* CopyToStack_fontSize_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).fontSize;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_fontSize_7(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.fontSize = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_fontSize_7(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @fontSize = ptr_of_this_method->Value;
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.fontSize = @fontSize;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_ch_8(ref object o)
        {
            return ((huqiang.Core.HGUI.CharacterInfoEx)o).ch;
        }

        static StackObject* CopyToStack_ch_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.CharacterInfoEx)o).ch;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = (int)result_of_this_method;
            return __ret + 1;
        }

        static void set_ch_8(ref object o, object v)
        {
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.ch = (System.Char)v;
            o = ins;
        }

        static StackObject* AssignFromStack_ch_8(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Char @ch = (char)ptr_of_this_method->Value;
            huqiang.Core.HGUI.CharacterInfoEx ins =(huqiang.Core.HGUI.CharacterInfoEx)o;
            ins.ch = @ch;
            o = ins;
            return ptr_of_this_method;
        }


        static object PerformMemberwiseClone(ref object o)
        {
            var ins = new huqiang.Core.HGUI.CharacterInfoEx();
            ins = (huqiang.Core.HGUI.CharacterInfoEx)o;
            return ins;
        }


    }
}
